﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using com.eforceglobal.crux.views.Common;
using com.eforceglobal.crux.controllers.Common;
using com.eforceglobal.crux.DTOs.Configuration;

public partial class Common_Error : BaseView, IError
{
    ErrorController _controller = null;

    protected void Page_Load(object sender, EventArgs e)
    {
        _controller = new ErrorController(this);
        _controller.InitView(IsPostBack);
    }


    #region IError Members

    public string ErrorCode
    {
        get { return Request.Params["id"].ToString(); }
    }

    public com.eforceglobal.crux.DTOs.Configuration.ErrorInformation ErrorInformation
    {
        get
        {
            ErrorInformation errorInformation = new ErrorInformation();
            errorInformation.ErrorNameOrCode = ErrorCode;
            errorInformation.ErrorDescription = lblErrorDescription.Text;
            errorInformation.ProbableCause = lblProbableCause.Text;
            errorInformation.ShortDescription = ViewTitle;
            errorInformation.RecommendedAction = lblRecommendedAction.Text;
            return errorInformation;
        }
        set
        {
            ViewTitle = value.ShortDescription;
            lblErrorDescription.Text = value.ErrorDescription;
            lblProbableCause.Text = value.ProbableCause;
            lblRecommendedAction.Text = value.RecommendedAction;
        }
    }

    #endregion
}
